<template>

账号:<input type="text" v-model="Zhanghao">
性别：<input type="radio" :value="true" v-model="Sex">男
<input type="radio" :value="false"   v-model="Sex">女

日期：<input  type="date"  v-model="date"> 


<input @click="Show" type="button" value="搜索">




<table>

    <thead>

        <tr>

<th>编号</th>
<th>性别</th>
<th>时间</th>
<th>姓名</th>
<th>账号</th>

</tr>

    </thead>
    <tbody  v-for="item in aa">
        <tr>

<th>{{ item.mid }}</th>
<th>{{ item.sex }}</th>
<th>{{ item.ctime }}</th>
<th>{{ item.mname }}</th>
<th>{{ item.zhanghao }}</th>

</tr>



    </tbody>


</table>


<button @click="FanYe(E)">上一页</button>
<button @click="FanYe(F)">上一页</button>




</template>
<script setup lang="ts">

 import axios from 'axios';
import {onMounted, ref} from 'vue';

    onMounted(()=>{

        Show();
    })

    const aa = ref([{
         mid: 0,
      sex: "",
      ctime: "",
      mname: "",
      pwd: "",
      zhanghao: ""


    }])



const Zhanghao =ref('');
const Sex=ref('')
const date= ref('')
const bb=ref({

    s:1,
    m:3,
    ZongYe:0,
    Count:0,



})



     const  Show=()=>{


            axios.get('https://localhost:7284/api/User/ShowMe',{params:{

                    s:bb.value.s,
                    m:bb.value.m,
                    Zhanghao:Zhanghao.value,
                    Sex:Sex.value,
                    Ctime:date.value
                    

                    

            }}).then(res=>{


                            aa.value=res.data.pageDate;   
                            bb.value.ZongYe =res.data.ZongYe
                            bb.value.Count=res.data.Count


            }).catch(error=>{


                    console.log(error)
            })

     }


     const FanYe=(chool:string )=>{
          

            switch (chool){

                case"F":
                  bb.value.s+=1
                  break;
                  case"E":
                  bb.value.s-=1
                  break;
            }
            Show();
            


        

     }

</script>